<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%--
  Created by IntelliJ IDEA.
  User: 徐永岳
  Date: 2023/4/10
  Time: 16:39
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>home page</title>
    <style>
        #container{
            width: 1200px;
            margin: auto;
        }

        .product{
            width: 380px;
            margin: 10px;
            background: goldenrod;
            text-align: center;
            float: left;
        }

        .picture{
            width: 300px;
        }

        .current-price{
            color: #f00;
            font-weight: bold;
        }

        .original-price{
            color: blueviolet;
            text-decoration: darkred;
        }
    </style>
</head>
<body bgcolor="#8a2be2">
<div id="container">
    <h1>商品查询首页</h1>
    <a href="/user/index.jsp">用户登录</a>
    <a href="/product/queryAll">添加商品</a>
    <form action="/product/query" method="post">
        <input type="test" name="title" placeholder="title">
        <input type="text" name="description" placeholder="description">
        <select name="type">
            <option value="">任意</option>
            <option value="自营">自营</option>
            <option value="第三方">第三方</option>
        </select>
        <input type="submit" value="查询">
    </form>
    <c:forEach var="product" items="${sessionScope.indexProducts}">
        <div class="product">
            <div><img class="picture" src="pictures/${product.picture}" alt=""> </div>
            <div>
                <p>${product.title}</p>
                <span class="current-price">${product.currentPrice}</span>
                <span class="original-price">${product.originalPrice}</span>
            </div>
        </div>
    </c:forEach>
</div>
</body>
</html>
